package com.heima.comment.controller;


import com.heima.comment.dto.CommentRepayDto;
import com.heima.comment.dto.CommentRepayLikeDto;
import com.heima.comment.dto.CommentRepaySaveDto;
import com.heima.comment.service.ICommentReplyService;
import com.heima.common.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/comment_repay")
public class CommentReplyController {

    @Autowired
    private ICommentReplyService replyService;

    // 回复评论
    @PostMapping("/save")
    public ResponseResult save(@RequestBody CommentRepaySaveDto dto){

        return replyService.save(dto);
    }

    // 查询回复列表
    @PostMapping("/load")
    public ResponseResult load(@RequestBody CommentRepayDto dto){

        return replyService.load(dto);
    }

    // 回复点赞
    @PostMapping("/like")
    public ResponseResult like(@RequestBody CommentRepayLikeDto dto){

        return replyService.like(dto);
    }


}
